package com.example.moshudriver.protocol;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import com.external.activeandroid.DataBaseModel;
import com.external.activeandroid.annotation.Column;
import com.external.activeandroid.annotation.Table;

@Table(name = "usercertifyRequest")
public class usercertifyRequest  extends DataBaseModel
{

     @Column(name = "uid")
     public int uid;

     @Column(name = "sid")
     public String   sid;

     @Column(name = "identity_card")
     public String   identity_card;

     @Column(name = "name")
     public String   name;

     @Column(name = "gender")
     public int gender;

     @Column(name = "ver")
     public int ver;

     @Column(name = "avatar")
     public String   avatar;

     @Column(name = "bankcard")
     public String   bankcard;

     public void  fromJson(JSONObject jsonObject)  throws JSONException
     {
          if(null == jsonObject){
            return ;
           }

          JSONArray subItemArray;

          this.uid = jsonObject.optInt("uid");

          this.sid = jsonObject.optString("sid");

          this.identity_card = jsonObject.optString("identity_card");

          this.name = jsonObject.optString("name");

          this.gender = jsonObject.optInt("gender");

          this.ver = jsonObject.optInt("ver");

          this.avatar = jsonObject.optString("avatar");

          this.bankcard = jsonObject.optString("bankcard");
          return ;
     }

     public JSONObject  toJson() throws JSONException 
     {
          JSONObject localItemObject = new JSONObject();
          JSONArray itemJSONArray = new JSONArray();
          localItemObject.put("uid", uid);
          localItemObject.put("sid", sid);
          localItemObject.put("identity_card", identity_card);
          localItemObject.put("name", name);
          localItemObject.put("gender", gender);
          localItemObject.put("ver", ver);
          localItemObject.put("avatar", avatar);
          localItemObject.put("bankcard", bankcard);
          return localItemObject;
     }

}
